package com.shop.service;

import cn.hutool.core.bean.BeanUtil;
import com.shop.dao.GoodsMapper;
import com.shop.dto.GoodsDto;
import com.shop.dto.GoodsDtoQuery;
import com.shop.entity.GoodsEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wzby
 * @Date: 2022/10/21 9:58
 */
@Service
public class GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;

    public List<GoodsDto> select(GoodsDtoQuery goodsDtoQuery){
        List<GoodsEntity> entities = goodsMapper.select(goodsDtoQuery);
        return BeanUtil.copyToList(entities,GoodsDto.class);
    }


}
